<template>
  <div class="search">
    <f-form ref="form" :action="api.sfinance" :form-key="this.formItem.sfinanceId">
      <f-form-item label="累计发货金额" name="saleAmount" :value="formItem.saleAmount"/>
      <f-form-item label="累计客户回款" name="returnAmount" :value="formItem.returnAmount"/>
      <f-form-item label="累计客户欠款" name="debtAmount" :value="formItem.debtAmount"/>
      <f-form-item label="累计垫付税金" name="supplierBondAmount" :value="formItem.supplierBondAmount"/>
      <f-form-item label="累计退垫付款" name="supplierBondReturnAmount" :value="formItem.supplierBondReturnAmount"/>
      <f-form-item label="累计发货底价" name="fahuoDjAmount" :value="formItem.fahuoDjAmount"/>
      <f-form-item label="累计成本金额" name="costAmount" :value="formItem.costAmount"/>
      <f-form-item label="累计供方高开税金" name="supplierGapUpTaxesAmount" :value="formItem.supplierGapUpTaxesAmount"/>
      <f-form-item label="累计供方已返款金额" name="supplierRealAmount" :value="formItem.supplierRealAmount"/>
      <f-form-item label="累计供方应返款金额" name="supplierRetableAmount" :value="formItem.supplierRetableAmount"/>
      <f-form-item label="累计应收供方金额" name="supplierAmount" :value="formItem.supplierAmount"/>
      <f-form-item label="备注" name="remark" :value="formItem.remark"/>
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'

  export default {
    name: 'financeForm',
    props: {},
    data() {
      return {
        refs: this.$refs,
        api: Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          financeId: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.sfinanceId) {
          let params = {
            financeId: data.sfinanceId
          }
          this.refs['form'].getDetails(params, (data) => {
            this.formItem = data
            this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({}, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
